package com.e3.basdoc.dept.client;

import java.util.List;

import com.e3.basdoc.dept.model.DeptModel;
import com.e3.template.tgf.MyTGFUI;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFFormPanel;
import com.e3.template.tgf.TGFGridPanel;
import com.e3.template.tgf.TGFQueryDialog;
import com.e3.template.tgf.TGFTreePanelAsync;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Description: <br>
 * 
 * @author: <a href="mailto:senton1101@126.com">TianXiangdong</a> 2010-7-27 上午10:41:03
 * @version: 1.0
 */
public class DeptUI extends MyTGFUI<DeptModel>{
	
	private DeptRPCServiceAsync service = DeptRPCService.Util.getInstance();

	@Override
	protected TGFFormPanel<DeptModel> createFormPanel() {
		return new DeptFormPanel();
	}

	@Override
	protected TGFGridPanel<DeptModel> createGridPanel() {
		return new DeptGridPanel();
	}

	@Override
	protected TGFTreePanelAsync<DeptModel> createTreePanel() {
		return new DeptTreePanel();
	}

	@Override
	protected TGFQueryDialog<DeptModel> createQueryDialog() {
		return new DeptQueryDialog();
	}

	@Override
	protected TGFEditorDialog<DeptModel> createEditorDialog() {
		return new DeptEditorDialog();
	}

	@Override
	protected void executeDeleteService(List<DeptModel> models,	AsyncCallback<Void> callback) {
		service.deleteDepts(models, callback);
	}

	@Override
	protected String getCurrentLocalName() {
		return DeptMessages.INSTANCE.local_name();
	}

	@Override
	protected DeptModel createModelInstance() {
		return DeptHelper.INSTANCE.createModelInstance();
	}
	
	@Override
	protected String getDeletedDetailInfo(List<DeptModel> models) {
		String msgs = super.getDeletedDetailInfo(models);
		return msgs+";"+DeptMessages.INSTANCE.msg_delete_confirm_notice();
	}
}
